//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#if _MSC_VER > 1000
#pragma once
#endif

#ifndef __EZSTRING_H__
#define __EZSTRING_H__

#include <elquintet.h>

_ELASTOS_NAMESPACE_BEGIN

typedef enum _StringCase
{
    StringCase_Sensitive         = 0x0000,
    StringCase_Insensitive       = 0x0001,
} StringCase;

typedef enum _Encoding
{
    Encoding_Default             = 0x0000,
    Encoding_ASCII               = 0x0001,
    Encoding_UTF7                = 0x0002,
    Encoding_UTF8                = 0x0003,
    Encoding_UTF16               = 0x0004,
    Encoding_GB18030             = 0x0005,
    Encoding_LATIN_1             = 0x0006,
    Encoding_BIG5                = 0x0007,
    Encoding_EUC_JP              = 0x0008,
} Encoding;

_ELASTOS_NAMESPACE_END

#ifdef __cplusplus
extern "C" {
#endif
    _ELASTOS Int32 __cdecl _WString_GetLength(const wchar_t *string,
        _ELASTOS Int32 nMaxLen);
    _ELASTOS Int32 __cdecl _AString_GetLength(const char *string,
        _ELASTOS Int32 nMaxLen);
    _ELASTOS Int32 __cdecl _WString_EstimateAStringLength(const wchar_t *wstr,
        _ELASTOS Encoding encoding);
    _ELASTOS Int32 __cdecl _AString_EstimateWStringLength(const char *str,
        _ELASTOS Encoding encoding);
    _ELASTOS Int32 __cdecl _WString_Compare(const wchar_t *string1,
        const wchar_t *string2, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _AString_Compare(const char *string1,
        const char *string2, _ELASTOS StringCase stringCase);
    wchar_t* __cdecl _WString_Duplicate(const wchar_t *strSource);
    char* __cdecl _AString_Duplicate(const char *strSource);

	void __cdecl _WString_Free(wchar_t * str);
	void __cdecl _AString_Free(char * str);


    _ELASTOS Int32 __cdecl _WString_ToInt32(const wchar_t *string);
    _ELASTOS Int32 __cdecl _AString_ToInt32(const char *string);
    _ELASTOS Int64 __cdecl _WString_ToInt64(const wchar_t *string);
    _ELASTOS Int64 __cdecl _AString_ToInt64(const char *string);
    _ELASTOS Boolean __cdecl _WString_ToBoolean(const wchar_t *string);
    _ELASTOS Boolean __cdecl _AString_ToBoolean(const char *string);
    _ELASTOS Double __cdecl _WString_ToDouble(const wchar_t *string);
    _ELASTOS Double __cdecl _AString_ToDouble(const char *string);

    _ELASTOS Int32 __cdecl _WString_GetCharCount(const wchar_t *string);
    _ELASTOS Int32 __cdecl _AString_GetCharCount(const char *string,
        _ELASTOS Encoding encoding);
    _ELASTOS Char32 __cdecl _WString_GetChar(const wchar_t *string,
        _ELASTOS Int32 index);
    _ELASTOS Char32 __cdecl _AString_GetChar(const char *string,
        _ELASTOS Int32 index, _ELASTOS Encoding encoding);

    _ELASTOS Boolean __cdecl _AString_Contains(const char *string,
        const char *substr, _ELASTOS StringCase stringCase,
        _ELASTOS Encoding encoding);
    _ELASTOS Boolean __cdecl _WString_Contains(const wchar_t *string,
        const wchar_t *substr, _ELASTOS StringCase stringCase);

    _ELASTOS Boolean __cdecl _AString_StartWith(const char *string,
        const char *substr, _ELASTOS StringCase stringCase,
        _ELASTOS Encoding encoding);
    _ELASTOS Boolean __cdecl _WString_StartWith(const wchar_t *string,
        const wchar_t *substr, _ELASTOS StringCase stringCase);
    _ELASTOS Boolean __cdecl _AString_EndWith(const char *string,
        const char *substr, _ELASTOS StringCase stringCase,
        _ELASTOS Encoding encoding);
    _ELASTOS Boolean __cdecl _WString_EndWith(const wchar_t *string,
        const wchar_t *substr, _ELASTOS StringCase stringCase);

    _ELASTOS Int32 __cdecl _AString_IndexOf_AChar(const char *string, char ch,
        _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _AString_IndexOf_AnyAChar(const char *string,
        const char* strCharSet, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _AString_IndexOf_Char(const char *string,
        _ELASTOS Char32 ch, _ELASTOS StringCase stringCase,
        _ELASTOS Encoding encoding);
    _ELASTOS Int32 __cdecl _AString_IndexOf_AnyChar(const char *string,
        _ELASTOS Char32 *strCharSet, _ELASTOS StringCase stringCase,
        _ELASTOS Encoding encoding);
    _ELASTOS Int32 __cdecl _AString_IndexOf_Substring(const char *string,
        const char *substr, _ELASTOS StringCase stringCase,
        _ELASTOS Encoding encoding);
    _ELASTOS Int32 __cdecl _WString_IndexOf_WChar(const wchar_t *string,
        wchar_t ch, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _WString_IndexOf_AnyWChar(const wchar_t *string,
        const wchar_t* strCharSet, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _WString_IndexOf_Char(const wchar_t *string,
        _ELASTOS Char32 ch, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _WString_IndexOf_AnyChar(const wchar_t *string,
        _ELASTOS Char32 *strCharSet, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _WString_IndexOf_Substring(const wchar_t *string,
        const wchar_t *substr, _ELASTOS StringCase stringCase);

    _ELASTOS Int32 __cdecl _AString_LastIndexOf_AChar(const char *string, char ch,
        _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _AString_LastIndexOf_AnyAChar(const char *string,
        const char* strCharSet, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _AString_LastIndexOf_Char(const char *string,
        _ELASTOS Char32 ch, _ELASTOS StringCase stringCase,
        _ELASTOS Encoding encoding);
    _ELASTOS Int32 __cdecl _AString_LastIndexOf_AnyChar(const char *string,
        _ELASTOS Char32 *strCharSet, _ELASTOS StringCase stringCase,
        _ELASTOS Encoding encoding);
    _ELASTOS Int32 __cdecl _AString_LastIndexOf_Substring(const char *string,
        const char *substr, _ELASTOS StringCase stringCase,
        _ELASTOS Encoding encoding);
    _ELASTOS Int32 __cdecl _WString_LastIndexOf_WChar(const wchar_t *string,
        wchar_t ch, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _WString_LastIndexOf_AnyWChar(const wchar_t *string,
        const wchar_t *strCharSet, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _WString_LastIndexOf_Char(const wchar_t *string,
        _ELASTOS Char32 ch, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _WString_LastIndexOf_AnyChar(const wchar_t *string,
        _ELASTOS Char32 *strCharSet, _ELASTOS StringCase stringCase);
    _ELASTOS Int32 __cdecl _WString_LastIndexOf_Substring(const wchar_t *string,
        const wchar_t *substr, _ELASTOS StringCase stringCase);

    char* __cdecl _AString_Substring_Buffer(const char *string, _ELASTOS Int32 start,
        _ELASTOS PCarQuintet pCq, _ELASTOS Encoding encoding);
    char* __cdecl _AString_Substring(const char *string, _ELASTOS Int32 start,
        _ELASTOS Encoding encoding);
    char* __cdecl _AString_Substring_Length_Buffer(const char *string,
        _ELASTOS Int32 start, _ELASTOS Int32 len, _ELASTOS PCarQuintet pCq,
        _ELASTOS Encoding encoding);
    wchar_t* __cdecl _WString_Substring_Buffer(const wchar_t *string,
        _ELASTOS Int32 start, _ELASTOS PCarQuintet pCq);
    wchar_t* __cdecl _WString_Substring(const wchar_t *string, _ELASTOS Int32 start);
    wchar_t* __cdecl _WString_Substring_Length_Buffer(const wchar_t *string,
        _ELASTOS Int32 start, _ELASTOS Int32 len, _ELASTOS PCarQuintet pCq);

    char* __cdecl _AString_ToLowerCase(const char *string, _ELASTOS PCarQuintet pCq,
        _ELASTOS Encoding encoding);
    wchar_t* __cdecl _WString_ToLowerCase(const wchar_t *string,
        _ELASTOS PCarQuintet pCq);
    char* __cdecl _AString_ToUpperCase(const char *string,
        _ELASTOS PCarQuintet pCq, _ELASTOS Encoding encoding);
    wchar_t* __cdecl _WString_ToUpperCase(const wchar_t *string,
        _ELASTOS PCarQuintet pCq);

    char* __cdecl _AString_TrimStart(const char *string, _ELASTOS PCarQuintet pCq);
    wchar_t* __cdecl _WString_TrimStart(const wchar_t *string,
        _ELASTOS PCarQuintet pCq);
    char* __cdecl _AString_TrimEnd(const char *string, _ELASTOS PCarQuintet pCq);
    wchar_t* __cdecl _WString_TrimEnd(const wchar_t *string,
        _ELASTOS PCarQuintet pCq);
    char* __cdecl _AString_Trim(const char *string, _ELASTOS PCarQuintet pCq);
    wchar_t* __cdecl _WString_Trim(const wchar_t *string, _ELASTOS PCarQuintet pCq);

#ifdef __cplusplus
}
#endif

#ifdef __cplusplus

_ELASTOS_NAMESPACE_BEGIN

class WStringBuf;
class AStringBuf;

class WString
{
public:
    WString() : m_wstring(NULL) {};  // e.g., WString ws;
//  This class accords with bitwise copy semantics, and needn't declare copy
//  contructor.
//  WString(const WString& wstr) : m_wstring(wstr.m_wstring) {};
    // e.g., WString ws(wstr);
    WString(const wchar_t* pwch) : m_wstring(pwch) {
    // e.g., WString ws(L"Hello");
        assert(sizeof(wchar_t) == 2);
        //on arm platform, the address of "wchar_t*" may not begin from even,
        //so we must assure it
        assert( !(((UInt32)pwch) & 0x1) &&
            "On arm platform, assure the address begin from even");
    };

    Int32 GetLength(Int32 maxLen = -1) const {  // e.g., ws.Length(64);
        return _WString_GetLength(m_wstring, maxLen);
    }

    Int32 EstimateAStringLength(Encoding encoding = Encoding_Default) const {
        return _WString_EstimateAStringLength(m_wstring, encoding);
    }

    Int32 Compare(WString wstr, StringCase stringCase = StringCase_Sensitive) const{
        return _WString_Compare(m_wstring, wstr.m_wstring, stringCase);
    }

    Boolean IsNull() const {
    // e.g., if (wstr.IsNull()) {...} or Boolean b = wstr.IsNull();
        return m_wstring == NULL;
    }

    Boolean IsEmpty() const {
        assert(m_wstring);
        return m_wstring[0] == '\0';
    }

    Boolean IsNullOrEmpty() const {
        return (m_wstring == NULL || m_wstring[0] == L'\0');
    }

    Int32 ToInt32() const {
        return _WString_ToInt32(m_wstring);
    }

    Int64 ToInt64() const {
        return _WString_ToInt64(m_wstring);
    }

    Boolean ToBoolean() const {
        return _WString_ToBoolean(m_wstring);
    }

    Double ToDouble() const {
        return _WString_ToDouble(m_wstring);
    }

    Int32 GetCharCount() const{
        return _WString_GetCharCount(m_wstring);
    }

    Char32 GetChar(Int32 index) const {
        return _WString_GetChar(m_wstring, index);
    }

    //----
    Boolean Contains(const WString& substr,
            StringCase stringCase = StringCase_Sensitive) const {
        return _WString_Contains(m_wstring, substr, stringCase);
    }

    Boolean StartWith(const WString& substr,
            StringCase stringCase = StringCase_Sensitive) const {
        return _WString_StartWith(m_wstring, substr, stringCase);
    }

    Boolean EndWith(const WString& substr,
            StringCase stringCase = StringCase_Sensitive) const {
        return _WString_EndWith(m_wstring, substr, stringCase);
    }

    //---- IndexOf ----
    Int32 IndexOf(WChar ch,  StringCase stringCase = StringCase_Sensitive) const {
        return _WString_IndexOf_WChar(m_wstring, ch, stringCase);
    }

    Int32 IndexOfAny(const WString& strCharSet,
            StringCase stringCase  = StringCase_Sensitive) const {
        return _WString_IndexOf_AnyWChar(m_wstring, strCharSet, stringCase);
    }

    Int32 IndexOfChar(Char32 ch,
            StringCase stringCase = StringCase_Sensitive) const {
        return _WString_IndexOf_Char(m_wstring, ch, stringCase);
    }

    Int32 IndexOfAnyChar(Char32 *strCharSet,
            StringCase stringCase = StringCase_Sensitive) const {
        return _WString_IndexOf_AnyChar(m_wstring, strCharSet, stringCase);
    }

    Int32 IndexOf(const WString& str,
            StringCase stringCase  = StringCase_Sensitive) const {
        return _WString_IndexOf_Substring(m_wstring, str, stringCase);
    }

    //---- LastIndexOf ----
    Int32 LastIndexOf(WChar ch,
            StringCase stringCase = StringCase_Sensitive) const {
        return _WString_LastIndexOf_WChar(m_wstring, ch, stringCase);
    }

    Int32 LastIndexOfAny(const WString& strCharSet,
            StringCase stringCase  = StringCase_Sensitive) const {
        return _WString_LastIndexOf_AnyWChar(m_wstring, strCharSet, stringCase);
    }

    Int32 LastIndexOfChar(Char32 ch,
            StringCase stringCase = StringCase_Sensitive) const {
        return _WString_LastIndexOf_Char(m_wstring, ch, stringCase);
    }

    Int32 LastIndexOfAnyChar(Char32 *strCharSet,
            StringCase stringCase = StringCase_Sensitive) const {
        return _WString_LastIndexOf_AnyChar(m_wstring, strCharSet, stringCase);
    }

    Int32 LastIndexOf(const WString& str,
            StringCase stringCase  = StringCase_Sensitive) const {
        return _WString_LastIndexOf_Substring(m_wstring, str, stringCase);
    }

    //---- Substring ----
    WString Substring(Int32 start, WStringBuf& sub) {
        return _WString_Substring_Buffer(m_wstring, start, (PCarQuintet)&sub);
    }

    WString Substring(Int32 start) {
        return _WString_Substring(m_wstring, start);
    }

    WString Substring(Int32 start, Int32 len, WStringBuf& sub) {
        return _WString_Substring_Length_Buffer(m_wstring, start, len,
            (PCarQuintet)&sub);
    }

    //---- ToLowerCase ----
    WString ToLowerCase(WStringBuf& lowser) {
        return _WString_ToLowerCase(m_wstring, (PCarQuintet)&lowser);
    }

    //---- ToUpperCase ----
    WString ToUpperCase(WStringBuf& upper) {
        return _WString_ToUpperCase(m_wstring, (PCarQuintet)&upper);
    }

    //---- TrimStart ----
    WString TrimStart(WStringBuf& str) const {
        return _WString_TrimStart(m_wstring, (PCarQuintet)&str);
    }

    //---- TrimEnd ----
    WString TrimEnd(WStringBuf& str) const {
        return _WString_TrimEnd(m_wstring, (PCarQuintet)&str);
    }

    //---- Trim ----
    WString Trim(WStringBuf& str) const {
        return _WString_Trim(m_wstring, (PCarQuintet)&str);
    }

    operator const wchar_t*() const{  //  for 3rd party API such as foo(wchar* pwch);
        return (wchar_t *)m_wstring;
    }

    void operator=(const WString& wstr) { // e.g., wstr1 = wstr2;
        m_wstring = wstr.m_wstring;
    }

    void operator=(const WStringBuf& wsb) { // e.g., wstr = wsb;
        m_wstring = (wchar_t *)((PCarQuintet)&wsb)->m_pBuf;
    }

    void operator=(const wchar_t* pwch) {  // e.g., wstr = L"Hello";
        m_wstring = pwch;
    }

    const WChar operator[](Int32 idx) const {
        assert(idx >= 0);
        return m_wstring[idx];
    }

    static WString Duplicate(const WString& strSource) {
        return _WString_Duplicate(strSource);
    }

    static void Free(WString& str) {
        _WString_Free((wchar_t *)str.m_wstring);
    }

private:
    void operator==(const wchar_t *) {}
    void operator!=(const wchar_t *) {}
    void operator!() {}
    void operator*() {}

    void operator+=(const wchar_t *) {}
    void operator+(const wchar_t *) {}

    void operator+=(const int) {}
    void operator-=(const int) {}
    void operator+(const int) {}
    void operator-(const int) {}

    const wchar_t* m_wstring;
};

class AString
{
public:
    // e.g., AString as;
    AString() : m_string(NULL) {}

//  This class accords with bitwise copy semantics, and needn't declare copy
//  contructor.
//  //e.g., AString as(str);
//  AString(const AString& str) : m_string(str.m_string) {};

    // e.g., AString as("Hello");
    AString(const char* pch) : m_string(pch) {}

    Int32 GetLength(Int32 maxLen = -1) const { // e.g., as.Length(64);
        return _AString_GetLength(m_string, maxLen);
    }

    Int32 EstimateWStringLength(Encoding encoding = Encoding_Default) const {
        return _AString_EstimateWStringLength(m_string, encoding);
    }

    Int32 Compare(const AString& str, StringCase stringCase = StringCase_Sensitive) const { //e.g., as.Compare(str);
        return _AString_Compare(m_string, str.m_string, stringCase);
    }

    Boolean IsNull() const {  // e.g., if (str.IsNull()) {...} or Boolean b = str.IsNull();
        return m_string == NULL;
    }

    Boolean IsEmpty() const {
        assert(m_string);
        return m_string[0] == '\0';
    }

    Boolean IsNullOrEmpty() const {
        return (m_string == NULL || m_string[0] == '\0');
    }

    Int32 ToInt32() const {
        return _AString_ToInt32(m_string);
    }

    Int64 ToInt64() const {
        return _AString_ToInt64(m_string);
    }

    Boolean ToBoolean() const {
        return _AString_ToBoolean(m_string);
    }

    Double ToDouble() const {
        return _AString_ToDouble(m_string);
    }

    Int32 GetCharCount(Encoding encoding = Encoding_Default) const {
        return _AString_GetCharCount(m_string, encoding);
    }

    Char32 GetChar(Int32 index, Encoding encoding = Encoding_Default) const {
        return _AString_GetChar(m_string, index, encoding);
    }

    //---- Contains ----
    Boolean Contains(const AString&  substr, StringCase stringCase = StringCase_Sensitive,
            Encoding encoding = Encoding_Default) const {
        return _AString_Contains(m_string, substr, stringCase, encoding);
    }

    Boolean StartWith(const AString&  substr,
            StringCase stringCase = StringCase_Sensitive,
            Encoding encoding = Encoding_Default) const {
        return _AString_StartWith(m_string, substr, stringCase, encoding);
    }

    Boolean EndWith(const AString& substr,
            StringCase stringCase = StringCase_Sensitive,
            Encoding encoding = Encoding_Default) const {
        return _AString_EndWith(m_string, substr, stringCase, encoding);
    }

    //---- IndexOf ----
    Int32 IndexOf(AChar ch, StringCase stringCase = StringCase_Sensitive) const {
        return _AString_IndexOf_AChar(m_string, ch, stringCase);
    }

    Int32 IndexOfAny(const AString& strCharSet,
            StringCase stringCase = StringCase_Sensitive) const {
        return _AString_IndexOf_AnyAChar(m_string, strCharSet, stringCase);
    }

    Int32 IndexOfChar(Char32 ch, StringCase stringCase  = StringCase_Sensitive,
            Encoding encoding = Encoding_Default) const {
        return _AString_IndexOf_Char(m_string, ch, stringCase, encoding);
    }

    Int32 IndexOfAnyChar(Char32 *strCharSet,
            StringCase stringCase = StringCase_Sensitive,
            Encoding encoding = Encoding_Default) const {
        return _AString_IndexOf_AnyChar(m_string, strCharSet, stringCase, encoding);
    }

    Int32 IndexOf(const AString& str, StringCase stringCase  = StringCase_Sensitive,
            Encoding encoding = Encoding_Default) const {
        return _AString_IndexOf_Substring(m_string, str, stringCase, encoding);
    }

    //---- LastIndexOf ----
    Int32 LastIndexOf(AChar ch,
            StringCase stringCase = StringCase_Sensitive) const {
        return _AString_LastIndexOf_AChar(m_string, ch, stringCase);
    }

    Int32 LastIndexOfAny(const AString& strCharSet,
            StringCase stringCase = StringCase_Sensitive) const {
        return _AString_LastIndexOf_AnyAChar(m_string, strCharSet, stringCase);
    }

    Int32 LastIndexOfChar(Char32 ch, StringCase stringCase  = StringCase_Sensitive,
            Encoding encoding = Encoding_Default) const {
        return _AString_LastIndexOf_Char(m_string, ch, stringCase, encoding);
    }

    Int32 LastIndexOfAnyChar(Char32 *strCharSet,
            StringCase stringCase = StringCase_Sensitive,
            Encoding encoding = Encoding_Default) const {
        return _AString_LastIndexOf_AnyChar(m_string, strCharSet,
            stringCase, encoding);
    }

    Int32 LastIndexOf(const AString& str, StringCase stringCase  = StringCase_Sensitive,
            Encoding encoding = Encoding_Default) const {
        return _AString_LastIndexOf_Substring(m_string, str, stringCase, encoding);
    }

    //---- Substring ----
    AString Substring(Int32 start, AStringBuf& sub,
            Encoding encoding = Encoding_Default) {
        return _AString_Substring_Buffer(m_string, start,
            (PCarQuintet)&sub, encoding);
    }

    AString Substring(Int32 start, Encoding encoding = Encoding_Default) {
        return _AString_Substring(m_string, start, encoding);
    }

    AString Substring(Int32 start, Int32 len, AStringBuf& sub,
            Encoding encoding = Encoding_Default) {
        return _AString_Substring_Length_Buffer(m_string, start, len,
            (PCarQuintet)&sub, encoding);
    }

    //---- ToLowerCase ----
    AString ToLowerCase(AStringBuf& lowser, Encoding encoding = Encoding_Default) {
        return _AString_ToLowerCase(m_string, (PCarQuintet)&lowser, encoding);
    }

    //---- ToUpperCase ----
    AString ToUpperCase(AStringBuf& upper, Encoding encoding = Encoding_Default) {
        return _AString_ToUpperCase(m_string, (PCarQuintet)&upper, encoding);
    }

    //---- TrimStart ----
    AString TrimStart(AStringBuf& str) const {
        return _AString_TrimStart(m_string, (PCarQuintet)&str);
    }

    //---- TrimEnd ----
    AString TrimEnd(AStringBuf& str) const {
        return _AString_TrimEnd(m_string, (PCarQuintet)&str);
    }

    //---- Trim ----
    AString Trim(AStringBuf& str) const {
        return _AString_Trim(m_string, (PCarQuintet)&str);
    }

    operator const char*() const
    {  //  for 3rd party API such as foo(char* pch);
        return (char *)m_string;
    }

    void operator=(const AString& str) { // e.g., str1 = str2;
        m_string = str.m_string;
    }

    void operator=(const AStringBuf& asb) { // e.g., str = asb;
        m_string = (char *)((PCarQuintet)&asb)->m_pBuf;
    }

    void operator=(const char* pch) {  // e.g., str = "Hello";
        m_string = pch;
    }

    const AChar operator[](Int32 idx) const {
        assert(idx >= 0);
        return m_string[idx];
    }

    static AString Duplicate(const AString& strSource) {
        return _AString_Duplicate(strSource);
    }

    static void Free(AString& str) {
        _AString_Free((char *)str.m_string);
    }

private:
    void operator==(const char *) {}
    void operator!=(const char *) {}
    void operator!() {}
    void operator*() {}

    void operator+=(const char *) {}
    void operator+(const char *) {}
    void operator+=(const int) {}
    void operator-=(const int) {}
    void operator+(const int) {}
    void operator-(const int) {}

    const char* m_string;
};

_ELASTOS_NAMESPACE_END

#else //!__cplusplus

typedef const wchar_t* WString;
typedef const char* AString;

#endif //__cplusplus

#endif //__EZSTRING_H__
